<?php

namespace App\Http\Requests\HotelReferral;

use App\Http\Requests\Request;

class StoreHotelReferralRequest extends Request
{
    /**
     * 验证通过
     *
     * @return bool
     */

    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        return [
            'category_id' => 'required',
            'desc' => 'required|max:500',
            'imgs' => 'required',
        ];
    }

    /**
     * 自定义验证
     *
     * @return array
     */
    public function messages()
    {
        return [
            'category_id.required'=>'分类不能为空',
            'desc.required'=>'描述信息不能为空',
            'desc.max'=>'字数不能大于500个',
            'imgs.required'=>'相册不能为空',
        ];
    }

}
